package com.me.Design;

import com.me.dao.base.PeopleModel;
import com.me.dao.util.PeopleCache;

/**
 * 功能：原型模式
 *
 * 理解:原型模式为初始化一个对象 在很多地方会用到 每次都new的话会耗费性能  因此采用clone 的方式
 * 保证初始对象不变
 *
 * @author：dell
 * @create：2019/2/7 19:29
 * @version：2019 Version：1.0
 * @company：老屋新房 Created with IntelliJ IDEA
 */
public class PrototypePatternDemo {

	public static void main(String[] args) {
		PeopleCache.loadPeopleModel();
		PeopleModel db = PeopleCache.getPeopleMode("大斌");
		System.out.println(db.toString());

		PeopleModel ly = PeopleCache.getPeopleMode("刘洋");
		System.out.println(ly.toString());
	}
}
